package com.nas.app.task.builder;

import java.util.ArrayList;
import java.util.List;

import com.nas.app.task.Argument;
import com.nas.app.task.Task;

public class TaskBuilder {
	public String taskName;
	public List<Argument> arguments;
	
	public static TaskBuilder typical() {
		TaskBuilder taskBuilder = new TaskBuilder();
		taskBuilder.taskName = "defaultTask";
		taskBuilder.withAn(ArgumentBuilder.typical().build());
		return taskBuilder;
	}
	
	public Task build() {
		Task task = new Task();
		task.setTaskName(taskName);
		task.setArguments(arguments);
		return task;
	}
	
	public TaskBuilder with(List<Argument> arguments) {
		this.arguments = arguments;
		return this;
	}
	
	public TaskBuilder withAn(Argument argument) {
		this.arguments = new ArrayList<Argument>();
		return this.moreAn(argument);
	}
	
	public TaskBuilder moreAn(Argument argument) {
		this.arguments.add(argument);
		return this;
		
	}
	
	public TaskBuilder with(String taskName) {
		this.taskName = taskName;
		return this;
	}
	
	
}
